﻿#ifndef PROCESSELLIPSE_H
#define PROCESSELLIPSE_H

/**
* @brief    进度条
* 1.
* @author    Wanglipeng
* @email     1594932770@qq.com
* @date      2021-05-15
*
*/

#include <QObject>
#include <QWidget>
class ProcessEllipse:public QWidget
{
    Q_OBJECT
public:
    explicit ProcessEllipse(QWidget* parent=nullptr);
public:
    int getNum() const;
    void setNum(int iNum);

    QColor getTextColor() const;
    void setTextColor(const QColor &TextColor);

    QColor getOuterRing() const;
    void setOuterRing(const QColor &OuterRing);

    QColor getInnerRingColor() const;
    void setInnerRingColor(const QColor &InnerRingColor);

    QColor getValueColor() const;
    void setValueColor(const QColor &ValueColor);

private:
    //绘制文本
    void drawText(QPainter& painter);
    //根据数字绘制 扫描圈
    void drawValue(QPainter& painter);
protected:
    void paintEvent(QPaintEvent *event);
    void resizeEvent(QResizeEvent *event);
private:
    //设置外圈颜色(默认红色)
    QColor m_OuterRingColor;
    //设置内圈颜色
    QColor m_InnerRingColor;
    //设置value对应颜色
    QColor m_ValueColor;
    //中心点坐标
    QPointF m_CenterPoint;
    //文本
    QColor m_TextColor;
    //设置数值
    int m_dbNum;
    //
    qreal m_dbStartAngel;
};

#endif // PROCESSELLIPSE_H
